@page "/Heatmap_Chart"
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<Tabs>
    <TabPane Key="1">
        <Tab>示例1</Tab>
        <ChildContent>
            <Heatmap @ref="chart1" Data="data1" Config="config1" />
        </ChildContent>
    </TabPane>
</Tabs>

@code{

    IChartComponent chart1;
    BasementProdItem[] data1;

    protected override async Task OnInitializedAsync()
    {
        data1 = await DemoData.BasementProdAsync(NavigationManager, HttpClient);
        await chart1.ChangeData(data1);

        await base.OnInitializedAsync();
    }

    #region 示例1

    HeatmapConfig config1 = new HeatmapConfig()
    {
        ForceFit = false,
        Width = 650,
        Height = 500,
        XField = "month_of_Year",
        YField = "district",
        ColorField = "aqhi",
        ShapeType = "rect",
        Color = new string[] { "#174c83", "#7eb6d4", "#efefeb", "#efa759", "#9b4d16" },
        Meta = new
        {
            Month_of_Year = new
            {
                Type = "cat",
            },
        },
    };


    #endregion 示例1
}

